//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_258 {
    public demo_258() {
    }

    public int addDigits(int num) {
        while(num > 9) {
            int sum;
            for(sum = 0; num > 0; num /= 10) {
                sum += num % 10;
            }

            num = sum;
        }

        return num;
    }

    public int addDigits2(int num) {
        while(num >= 10) {
            num = num / 10 + num % 10;
        }

        return num;
    }

    public int addDigits3(int num) {
        return (num - 1) % 9 + 1;
    }
}
